package com.cloud.code.牛客网;

import java.util.Scanner;

/**
 * 单词消消乐
 *
 */
public class Test16 {

    public static void main(String[] args) {

        Scanner scanner = new Scanner(System.in);
        while (scanner.hasNext()){
            String line = scanner.nextLine();

            String dfs = dfs(line);

            System.out.println(dfs);
        }
    }

    private static String dfs(String line) {

        for (int i = 0; i < line.length(); i++) {
            String str = line.charAt(i)+String.valueOf(line.charAt(i));
            if(line.contains(str)){
                return dfs(line.replace(str,""));
            }
        }

        return line;
    }
}
